import Taro from '@tarojs/taro'

const loading = (status, title = '加载中') => {
  if (status) {
    Taro.showLoading({
      title,
      mask: true
    })
  } else Taro.hideLoading()
}

const toast = (status, title, icon = 'none', mask = true, duration = 2000) => {
  if (status) {
    Taro.showToast({
      title,
      icon,
      mask,
      duration
    })
  } else Taro.hideToast()
}

export {
  loading,
  toast,
}
